<% var jstpl={ %>
<script>
    var form = layui.form;
    form.on('submit(form_submit)', function(data) {
        Ajax("/system/agent/addSubsidy", data.field, function(ret) {
            if (ret.state) {
                location.href = "/system/agent";
            } else {
                layer.msg(ret.msg);
            }
        });
        // console.log(data.elem); //被执行事件的元素DOM对象，一般为button对象
        // console.log(data.form); //被执行提交的form对象，一般在存在form标签时才会返回
        // console.log(data.field); //当前容器的全部表单字段，名值对形式：{name: value}
        return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
    });

 </script>
<% }; %>
<%layout("../layout/_layout_layui.html",{title:"添加区域代理商补贴",jstpl:jstpl}){ %>
<form class="layui-form">
    <input type="hidden" name="agentId" value="${agentId!}">
    <div class="layui-form-item">
        <label class="layui-form-label">区域代理商补贴金额</label>
        <div class="layui-input-block">
            <input type="text" name="subsidy" lay-verify="required" autocomplete="off" placeholder="请输入区域代理商补贴金额" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">订单id</label>
        <div class="layui-input-block">
            <input type="text" name="orderId" value="${banner.title!}" lay-verify="required" autocomplete="off" placeholder="请输入订单id" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-layout-admin">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="form_submit">提交</button>
            <!--<button type="reset" class="layui-btn layui-btn-primary">重置</button>-->
        </div>
    </div>
</form>
<%}%>